//
// Created by Martin on 2021/9/29.
//

#include "Context.h"
#include "Strategy.h"
#include "ConcreteStrategyA.h"
#include "ConcreteStrategyB.h"
#include "ConcreteStrategyC.h"
#include <iostream>

using namespace std;


/**
 * 策略模式(Strategy) 客户端
 */
int main()
{
    Context *context;
    Strategy *strategyA = new ConcreteStrategyA();
    Strategy *strategyB = new ConcreteStrategyB();
    Strategy *strategyC = new ConcreteStrategyC();

    context = new Context(strategyA);
    context->contextInterface();
    delete strategyA;
    delete context;

    context = new Context(strategyB);
    context->contextInterface();
    delete strategyB;
    delete context;

    context = new Context(strategyC);
    context->contextInterface();
    delete strategyC;
    delete context;

    return 0;
}